xquery version "0.9-ml"

"<list>"
,
let $node := xdmp:get-request-field("node")
(: let $node := "doc('wines.xml')/wines/wine/vintage" :)

for $value in fn:distinct-values(xdmp:eval($node))
	order by $value
	
	return
	<option>
	{$value}
	</option>
,
"</list>"